Page({
  data: {
    appoint: [],
  },
  onLoad(options) {
    var that=this
    //拿医师id
    console.log(options.doctorId)
    let doctorId = options.doctorId
    //根据医师id取得这个医师的所有预约信息
    wx.cloud.callFunction({
      name: 'appoint',
      data: {
        action: 'findDoctorNoDay',
        doctorId: doctorId,
      }
    }).then(res => {
      console.log('获取这个医师的所有预约信息成功', res)
      that.setData({
        appoint: res.result.data.reverse(),
      })
    }).catch(res => {
      console.log('获取这个医师的所有预约信息失败', res)
    })
  },
  //查看已完成的订单
  seeOrder(e){
    wx.navigateTo({
      url: '/pages/order/order?flowId='+e.currentTarget.dataset.flowid,
    })
  }
})